"guess 数"#用创建函数（def）来实现循环，引用sys函数来结束循环
import sys

CX = input("是否开始游戏：")
#重复程序
def 重复():
    mr = input("继续执行程序是/否:")
    if mr == "否":
        print("结束")
    elif mr == "是":
        输入()
        return 重复()
def 输入():
    while CX == "是" :
        temp = input("猜数")
        guess = int(temp)
        if guess == 10:
            print("yes")
            sys.exit(0)
        else:
            print("no")
            if guess >> 10:
                print("大了")
            elif guess << 10:
                print("小了")
        print("是否重来")
        重复()
    while CX == "否" :
        print("结束")
        sys.exit(0)
    else:
        print("无效")
输入()



